<input type="hidden" name="firewall[install]" value="1" />

<div class="container-fluid cm-container-white section-title">
    <h1>Firewall</h1>

    <p>Open select ports</p>
</div>

<div id="firewall-container"
     class="container-fluid collapse in">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="help-block col-xs-12">
                Warning: This is for fairly advanced use! Try to only open ports as
                you need them. The SSH port (usually <code>22</code> and defined in
                <code>vagrantfile.ssh.port</code>) is automatically opened for you.
            </div>
        </div>
    </div>

    <div class="clearfix"></div>

    <div class="panel panel-primary">
        <div class="panel-heading">Firewall Rules</div>
        <div class="panel-body">
            <ul class="nav nav-tabs nested-tabs sortable">
                <li class="add">
                    <a href="{{ path('puphpet.firewall.rule') }}"
                       data-toggle="add-block">
                        <i class="fa fa-plus"></i> Add</a>
                </li>
                {% for index, rule in firewall.rules %}
                    {% set blockId = "firewall-rules-#{index}" %}
                    {% set blockName = "firewall[rules][#{index}]" %}
                    <li class="{{ loop.first ? 'active' }}">
                        <a href="#" data-target="#{{ blockId }}"
                           data-toggle="tab">{{ index }}</a>
                        <div class="btn-group">
                            <button type="button" class="btn btn-default"
                                    data-toggle="delete-block"
                                    data-target="#{{ blockId }}">
                                <i class="fa fa-close"></i></button>
                        </div>
                        <input type="hidden" name="{{ blockName }}" value="1" />
                    </li>
                {% endfor %}
            </ul>

            <div class="tab-content">
                <div class="empty-tabs">
                    <i class="fa fa-share fa-rotate-270" aria-hidden="true"></i>
                    Click to add a firewall rule
                </div>
                {% for index, rule in firewall.rules %}
                    {% include 'PuphpetBundle:firewall:rule.html.twig' with {
                        'rule': rule,
                        'uniqid': index,
                        'active': loop.first ? true : false,
                    } %}
                {% endfor %}
            </div>
        </div>
    </div>
</div>

<div class="container-fluid cm-container-white section-footer">
    <a href="#locale" data-toggle="tab" class="btn btn-primary btn-lg pull-left">
        <i class="fa fa-arrow-left" aria-hidden="true"></i>
        Locale
    </a>

    <a href="#resolv" data-toggle="tab" class="btn btn-primary btn-lg pull-right">
        Resolv
        <i class="fa fa-arrow-right" aria-hidden="true"></i>
    </a>
</div>
